• File: Basic_swipe.html
  • Full Path: C:/htdocs/javascript/touchswipe/demos/Basic_swipe.html
  • Date Modified: 04/30/2025 7:56 AM
  • File size: 2.38 KB
  • MIME-type: text/html
  • Charset: utf-8
<!DOCTYPE HTML>
<html>
    <head>  
        <meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=no"/>
        <meta http-equiv="x-ua-compatible" content="IE=9">
        <link href="http://netdna.bootstrapcdn.com/twitter-bootstrap/2.2.2/css/bootstrap-combined.min.css" rel="stylesheet">
        <link href="http://twitter.github.com/bootstrap/assets/js/google-code-prettify/prettify.css" rel="stylesheet" />
        <link href="css/main.css" type="text/css" rel="stylesheet" />
        
        <script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.8.2/jquery.min.js"></script>
        <script type="text/javascript" src="https://google-code-prettify.googlecode.com/svn/loader/run_prettify.js"></script>
        <script type="text/javascript" src="../jquery.touchSwipe.min.js"></script>
        <script type="text/javascript" src="js/main.js"></script>
        
        <title>touchSwipe</title>
    </head>
    <body>
		<a href="https://github.com/mattbryson"><img style="position: absolute; top: 0; right: 0; border: 0;" src="https://s3.amazonaws.com/github/ribbons/forkme_right_white_ffffff.png" alt="Fork me on GitHub"></a>
		<div class="container">
		test af Jan
			
			<script id='code_1'>
				$(function() {			
					//Enable swiping...
					$("#test").swipe( {
						//Generic swipe handler for all directions
						swipe:function(event, direction, distance, duration, fingerCount, fingerData) {
							$(this).text("You swiped " + direction );	
						},
						//Default is 75px, set to 0 for demo so any distance triggers swipe
					   threshold:0
					});
				});
			</script>
			
			<span class='title'></span>
		  	<h4>events: <span class='events'><code>swipe</code>,<code>swipeLeft</code>, <code>swipeRight</code>, <code>swipeUp</code>, <code>swipeDown</code></span></h4>
			<p>By using the <code>swipe</code> handler, you can detect all 4 directions, or use the individual methods <code>swipeLeft</code>, <code>swipeRight</code>, <code>swipeUp</code>, <code>swipeDown</code></p>
		   	
		   	<button class='btn btn-small btn-info example_btn'>Jump to Example</button>
		   	<pre class="prettyprint" data-src='code_1'></pre>
			<span class='navigation'></span>
			
			<div id="test" class="box">Swipe me</div>
			
			<span class='navigation'></span>
		</div>		
   </body>
</html>